from django.contrib import admin
from .models import *
from .forms import SystemSettingForm

# Register your models here.


class SystemSettingAdmin(admin.ModelAdmin):
    form = SystemSettingForm
    list_display = ('postage', 'procedure', 'kefu_phone', 'jubao_phone')

    def has_add_permission(self, request):
        return True
    def has_delete_permission(self, request, obj=None):
        return True
admin.site.register(SystemSetting, SystemSettingAdmin)


class SystemLogAdmin(admin.ModelAdmin):
    list_display = ('level', 'text_log', 'json_log', 'get_add_time')
    fields = ('level', 'text_log', 'json_log')
admin.site.register(SystemLog, SystemLogAdmin)

from django_celery_results.models import TaskResult
from django_celery_results.admin import TaskResultAdmin

admin.site.unregister(TaskResult)
class MyTaskResultAdmin(TaskResultAdmin):
    pass
admin.site.register(TaskResult, TaskResultAdmin)